﻿using System;
using UnityEngine;
using UniRx;

public class KeyStream
{
    /// <summary>
    /// 按键
    /// </summary>
    public KeyCode key;

    /// <summary>
    /// 按下，按下时生效。等同于 Input.GetKeyDown
    /// </summary>
    public IObservable<Unit> down;

    /// <summary>
    /// 抬起，抬起时生效。等同于 Input.GetKeyUp
    /// </summary>
    public IObservable<Unit> up;

    /// <summary>
    /// 按住，按住时持续生效。等同于 Input.GetKey
    /// </summary>
    public IObservable<Unit> press;

    /// <summary>
    /// 长按。按下时生效一次，0.5s延迟后持续每0.1s生效一次
    /// </summary>
    public IObservable<Unit> longpress;
}